InStr (str1, str2), InStr (start, str1, str2)

Basic and Crystal syntax.

Arguments
Returns

Whole Number

Action

The InStr function returns the position of the first occurrence of one string within another. This position is a 1 based index of the characters in str1. If str2 is not found in str1, the InStr function returns 0. The start argument sets the starting position for the search.

Typical uses

Use this function to determine if one string contains another.

Examples

The following examples are applicable to both Basic and Crystal syntax:

InStr("abcdefg", "bcd")

Returns 2.

InStr(3, "abcdefg", "cde")

Returns 3.

Comments


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com